//package cur.nature.component.nacos.config;
//
//import cur.nature.component.nacos.handler.CustomClientHttpRequestInterceptor;
//import org.springframework.boot.web.client.RestTemplateBuilder;
//import org.springframework.cloud.client.loadbalancer.LoadBalanced;
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//import org.springframework.web.client.RestTemplate;
//
//@Configuration
//public class RestTemplateConfig {
//
//    // 启动负载均衡
//    @LoadBalanced
//    @Bean
//    RestTemplate loadBalanced(RestTemplateBuilder builder) {
//        RestTemplate restTemplate =  builder.build();
//        restTemplate.getInterceptors().add(new CustomClientHttpRequestInterceptor());
//        return restTemplate;
//    }
//
//    // 不启动负载均衡
////    @Bean
////    public RestTemplate restTemplate(RestTemplateBuilder builder) {
////        RestTemplate restTemplate =  builder.build();
////        restTemplate.getInterceptors().add(new CustomClientHttpRequestInterceptor());
////        return restTemplate;
////    }
//
//}
